package com.wenjie.springbootbugdetection.service.impl;

import com.wenjie.springbootbugdetection.mapper.AdminMapper;
import com.wenjie.springbootbugdetection.model.Admin;
import com.wenjie.springbootbugdetection.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Yang wenjie
 * @date 2021/7/13 8:51
 * Nice to Meet you!
 */
@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    @Override
    public List<Admin> select_All_Admins() {
        return adminMapper.selectAllAdmins();
    }

    @Override
    public Integer deleteAAdmin(Integer id) {
        return adminMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Admin selectAdmin(Integer id) {
        return adminMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateAAdmin(Admin admin) {
        return adminMapper.updateByPrimaryKeySelective(admin);
    }

    @Override
    public int insertAAdmin(Admin admin) {
        return adminMapper.insert(admin);
    }
}
